package p.ithorns.integration.aop.point;

import org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * LogAdvisor
 * TODO ithorns
 *
 * @author Ht.L
 * @date 2024-03-10 14:10
 * @since 1.0.0
 */
//@Component
public class Log2Advisor extends AspectJExpressionPointcutAdvisor implements InitializingBean {

    @Value("${pointcut}")
    private String pointcut;

    public Log2Advisor(Log2Advice advice) {
        setAdvice(advice);
        setExpression(pointcut);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        setExpression(pointcut);
    }
}